﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StepsLib
{
   public static class Helper
    {
        public static GraphicsPath Path(this Point[] points)
        {
            GraphicsPath graphicsPath = new GraphicsPath();
            graphicsPath.Reset();
            graphicsPath.AddPolygon(points);
            return graphicsPath;
        }
        public static bool InRegion(this Point point, Point[] points)
        {
            GraphicsPath path = points.Path();
            Region region = path.Region();
            return region.IsVisible(point);
        }

        public static Region Region(this GraphicsPath path)
        {
            Region region = new Region();
            region.MakeEmpty();
            region.Union(path);
            return region;
        }


    }
}
